﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using VodafoneWP7.Resources;
using System.Windows.Threading;
using System.Windows.Navigation;
using System.IO;
using System.Xml.Serialization;

namespace VodafoneWP7
{
    public enum MessageType
    {
        SMS,
        MMS,
        None
    }
    
    public class Account
    {
        public static int SIGNATURE_MAX_LENGTH = 20;
        public static int HEADER_MAX_LENGTH = 20;

        public string Name { get; set; }
        public string Username { get; set; }


        public string _password;
        
        [XmlIgnore]
        private string _tempPassword;
        [XmlIgnore]
        public string Password { get { return _password; } set { _tempPassword = _password = value; } }
        [XmlIgnore]
        public string TemporaryPassword { get { return _tempPassword; } }

        public bool SavePassword { get; set; }
        public MessaggingServiceType MessagingService { get; set; }
        public List<Message> messages { get; set; }
        public string Header { get; set; }
        public string Footer { get; set; }
        public bool EnableHeader { get; set; }
        public bool EnableSignature { get; set; }



        public long ID;

        //[XmlIgnore]
        //public AMessageService messaggingService;

        public Account()
        {
            ID = DateTime.Now.Ticks;
            Name = "";
            Username = "";
            Password = "";
            SavePassword = false;
            Header = "";
            Footer = "";
            messages = new List<Message>();
            EnableHeader = false;
            EnableSignature = false;
            MessagingService = MessaggingServiceType.Wp7;
        }
    }

    public class Message
    {
        public MessageType type;
        public string number;
        public string text;
        public DateTime dateTime;
        public string sender;
        
        public Message()
        {
            type = MessageType.None;
            number = "";
            text = "";
            dateTime = DateTime.Now;
            sender = "";
        }

        public static string GetMessageTypeString(MessageType type)
        {
            if (type == MessageType.SMS)
                return "SMS";
            else if (type == MessageType.MMS)
                return "MMS";
            else
                return "---";
        }
    }
    
}
